using System;
using Microsoft.SPOT;

namespace Gadgeteer.Modules.Community.XBee
{
    /// <summary>
    /// handles parsing a NodeDescription message
    /// </summary>
    public class NodeDiscoveryResponse : ATResponse
    {
        /// <summary>
        /// A <see cref="T:Gadgeteer.Modules.Community.XBee.NodeDescription" /> that contains node description data.
        /// </summary>
        public NodeDescription NodeDescription { get; private set; }

        /// <summary>
        /// parses the API message
        /// </summary>
        /// <param name="message">an API Message</param>
        protected override void ParseCommandData(byte[] message)
        {
           this.NodeDescription = NodeDescription.ParseNodeDiscoveryResponse(message);
        }

        /// <summary>
        /// override of CommandDataToString
        /// </summary>
        /// <returns>the NodeDescription.ToString()</returns>
        protected override string CommandDataToString()
        {
            return this.NodeDescription.ToString();
        }

        /// <summary>
        /// override of MessageTypeToString
        /// </summary>
        /// <returns>'Node Discovery Response'</returns>
        protected override string MessageTypeToString()
        {
            return "Node Discovery Response";
        }

    }
}
